"use strict";

function _instanceof(left, right) { if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) { return !!right[Symbol.hasInstance](left); } else { return left instanceof right; } }

function _classCallCheck(instance, Constructor) { if (!_instanceof(instance, Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }

function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

var JDS =
/*#__PURE__*/
function () {
  function JDS(opt) {
    _classCallCheck(this, JDS);

    _defineProperty(this, "V", '2.0');

    _defineProperty(this, "W", $(window).width());

    _defineProperty(this, "J", "        __\n       /\\ \\\n  __   \\_\\ \\    ____\n /\\ \\  /'_  \\  /',__\\\n \\ \\ \\/\\ \\ \\ \\/\\__, `\\\n _\\ \\ \\ \\___,_\\/\\____/\n/\\ \\_\\ \\/__,_ /\\/___/\n\\ \\____/\n \\/___/");

    _defineProperty(this, "tileTime", null);

    // 实例化立刻实行
    // console.log(`${this.J} V:${this.V}`);
    // 判断用户是否自定义了
    opt ? null : opt = {};
    this.opt = opt;
    this.opt.angaAnimaSpeed ? this.opt.angaAnimaSpeed = parseInt(this.opt.angaAnimaSpeed) : this.opt.angaAnimaSpeed = 600;
    this.opt.angaAnimaMoreY ? this.opt.angaAnimaMoreY = parseInt(this.opt.angaAnimaMoreY) : this.opt.angaAnimaMoreY = 0;
    this.opt.angaAnimaLoadOn == undefined ? this.opt.angaAnimaLoadOn = true : this.opt.angaAnimaLoadOn = this.opt.angaAnimaLoadOn;
    this.opt.animateOn ? this.opt.animateOn = this.opt.animateOn : this.opt.animateOn = false;
    this.opt.wowOn ? this.opt.wowOn = this.opt.wowOn : this.opt.wowOn = false;
    this.opt.skrollrOn ? this.opt.skrollrOn = this.opt.skrollrOn : this.opt.skrollrOn = false;
    this.opt.tilePC ? this.opt.tilePC = this.opt.tilePC : this.opt.tilePC = null;
    this.opt.tileSP ? this.opt.tileSP = this.opt.tileSP : this.opt.tileSP = null;
    console.log(this.opt); // 实例化后要实行的内容

    this.init();
  } // 默认加载 3.3.1 可以自定义加载


  _createClass(JDS, [{
    key: "plus",
    value: function plus(fun) {
      var src = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'https://code.jquery.com/jquery-3.3.1.min.js';
      jQuery.getScript(src, function () {
        var jQuery_3_3_1 = $.noConflict(true);

        (function ($) {
          if (fun) {
            fun($);
          }
        })(jQuery_3_3_1);
      });
    } // 初始化默认启动项目

  }, {
    key: "init",
    value: function init() {
      var _this2 = this;

      // 隐藏元素无法获取高度 所以先实行
      this.tileRun(); // 以下库加载

      this.animate();
      this.wow();
      this.skrollr(); // 以上库加载
      // 以下都有高度内容

      this.photoThumbnail();
      this.slides();
      this.tabBox();
      this.swiper();
      this.multiCheck();
      this.singleCheck();
      this.coponSwitch();
      this.searchRight();
      this.searchLight();
      this.megaMenu();
      this.mapList();
      this.smartMenu();
      this.macy(); // 以上都有高度内容

      this.angaAnima();
      this.imgOver();
      this.baguetteBox();
      this.colorBox();

      window.onload = function () {
        // 对高度有精确要求的内容放入 initOnload 内
        _this2.initOnload(); // skrollr 插件要求必须 onload 后初始化


        if (_this2.opt.skrollrOn) {
          console.log('jdsSkrollr init');
          var jdsSkrollr = skrollr.init();
        }
      };
    }
  }, {
    key: "initOnload",
    value: function initOnload() {
      console.log('=========================== init onload');
      this.angaAnimaLoad();
      this.showFix(); // 初始化就运行所以放入 onload 内

      this.alwaysFix(); // 必须放在 onload 内不然会错位

      this.triggerClick(); // 比如点击锚点需要高度都加载好才能正确定走位

      this.searchSp(); // 检索框大挪移
    }
  }, {
    key: "tileAll",
    value: function tileAll(funPC, funSP) {
      var _this3 = this;

      console.log('tileAll run !!!!!!!!!!!!');
      $(window).resize(function () {
        _this3.W = $(window).width();
      });

      if (this.W > 720) {
        if (funPC) {
          funPC();
          console.log('tilePC');
        }
      } else {
        if (funSP) {
          funSP();
          console.log('tileSP');
        }
      }

      ;
      $(window).resize(function () {
        if (_this3.tileTime !== false) {
          clearTimeout(_this3.tileTime);
        }

        ;
        _this3.tileTime = setTimeout(function () {// this.tileAll(funPC,funSP);
          // this.tileRun();
        }, 200);
      });
    }
  }, {
    key: "tileRun",
    value: function tileRun() {
      this.tileAll(this.opt.tilePC, this.opt.tileSP);
    }
  }, {
    key: "angaAnima",
    value: function angaAnima() {
      $('#widewrapper a[href^=#]').not('#search-box a,a.jdsPagetop,a.jdsColorBoxHtml').Plugin_AngaAnima({
        animaSpeed: this.opt.angaAnimaSpeed,
        moreY: this.opt.angaAnimaMoreY
      });
      $('#widewrapper a.jdsPagetop').Plugin_AngaAnima({
        animaSpeed: this.opt.angaAnimaSpeed,
        moreY: 0
      });
    }
  }, {
    key: "angaAnimaLoad",
    value: function angaAnimaLoad() {
      if (this.opt.angaAnimaLoadOn) {
        $('body').Plugin_AngaLoad({
          speeder: this.opt.angaAnimaSpeed,
          moreY: this.opt.angaAnimaMoreY
        });
      }
    }
  }, {
    key: "photoThumbnail",
    value: function photoThumbnail() {
      if ($('.jdsPhotoThumbnail').length <= 0) {
        return;
      }

      ;
      console.log('photoThumbnail run');
      $('.jdsPhotoThumbnail').each(function () {
        var this_jdsPhotoThumbnail = $(this);
        var this_hover = $(this).attr('hover');
        var handleClick = true;
        $(this_jdsPhotoThumbnail).find('.photoMore > div').hide();
        $(this_jdsPhotoThumbnail).find('.photoMore > div').eq(0).show();

        if (this_hover == 'true' && $(window).width() > 720) {
          $(this_jdsPhotoThumbnail).find('.thumPhotos img').each(function (i) {
            $(this).hover(function () {
              var ImgSrc = $(this).attr('src');
              var ImgAlt = $(this).attr('alt');
              var $mainPhoto = this_jdsPhotoThumbnail.find('img.mainPhoto');
              $mainPhoto.attr({
                src: ImgSrc,
                alt: ImgAlt
              });
              $mainPhoto.hide();
              $mainPhoto.fadeIn(0);
              $(this_jdsPhotoThumbnail).find('.photoMore > div').hide();
              $(this_jdsPhotoThumbnail).find('.photoMore > div').eq(i).fadeIn(0);
              return false;
            });
            $(this).click(function () {
              return false;
            });
          });
        } else {
          $(this_jdsPhotoThumbnail).find('.thumPhotos img').each(function (i) {
            $(this).click(function () {
              if (handleClick) {
                handleClick = false;
                var ImgSrc = $(this).attr('src');
                var ImgAlt = $(this).attr('alt');
                var $mainPhoto = this_jdsPhotoThumbnail.find('img.mainPhoto');
                $mainPhoto.attr({
                  src: ImgSrc,
                  alt: ImgAlt
                });
                $mainPhoto.hide();
                $mainPhoto.fadeIn(300, function () {
                  handleClick = true;
                });
                $(this_jdsPhotoThumbnail).find('.photoMore > div').hide();
                $(this_jdsPhotoThumbnail).find('.photoMore > div').eq(i).fadeIn(300);
              }

              return false;
            });
          });
        }

        ;
      });
    }
  }, {
    key: "getAttrSet",
    value: function getAttrSet(obj, attr, def, id, num) {
      var ojbAttr = $(obj).attr(attr);

      if (ojbAttr) {
        if (id == true) {
          ojbAttr = '#' + ojbAttr;
        }

        ;

        if (num == true) {
          ojbAttr = parseInt(ojbAttr);
        }

        ;
        return ojbAttr;
      } else {
        return def;
      }

      ;
    }
  }, {
    key: "slides",
    value: function slides() {
      var _this4 = this;

      if ($('.jdsSlides').length <= 0) {
        return;
      }

      ;
      console.log('slides run');
      $('.jdsSlides').Plugin_LoadJS({
        about: 'responsiveslides.min.js',
        url: ['https://img.travel.rakuten.co.jp/special/smap/js/responsiveslides.min.js'],
        successDo: function successDo() {
          var root = _this4;
          $('.jdsSlides').each(function (i) {
            $(this).addClass('jdsSlides' + (i + 1));
            $('.jdsSlides' + (i + 1)).responsiveSlides({
              auto: root.getAttrSet(this, 'auto', 1, '', true),
              timeout: root.getAttrSet(this, 'timeout', 4000, '', true),
              pager: root.getAttrSet(this, 'pager', false),
              nav: root.getAttrSet(this, 'nav', false),
              manualControls: root.getAttrSet(this, 'manualControls', '', true)
            });
          });
        }
      });
    }
  }, {
    key: "showFix",
    value: function showFix() {
      if ($('.jdsShowFix').length <= 0) {
        return;
      }

      ;
      console.log('showFix run');
      var root = this;
      $('.jdsShowFix').each(function (i) {
        $(this).addClass('jdsShowFix' + (i + 1));
        $('.jdsShowFix' + (i + 1)).Plugin_ShowFix({
          fixY: '#' + $(this).attr('fixY'),
          showOnly: root.getAttrSet(this, 'showOnly', false, true)
        });
      });
    }
  }, {
    key: "alwaysFix",
    value: function alwaysFix() {
      if ($('.jdsAlwaysFix').length <= 0) {
        return;
      }

      ;
      console.log('alwaysFix run');
      var root = this;
      $('.jdsAlwaysFix').each(function (i) {
        if ($(this).attr('menu') == 'true') {
          $(this).wrapAll('<div style="height:' + $(this).height() + 'px"></div>');
        }

        $(this).addClass('jdsAlwaysFix' + (i + 1));
        $('.jdsAlwaysFix' + (i + 1)).Plugin_AlwaysFix({
          moreY: root.getAttrSet(this, 'moreY', 0, '', true)
        });
      });
    }
  }, {
    key: "coponSwitch",
    value: function coponSwitch() {
      if ($('.jdsCoponSwitch').length <= 0 && $('.cp__trigger').length <= 0) {
        return;
      }

      ;
      console.log('coponSwitch run');
      var root = this;
      $('.jdsCoponSwitch').each(function (i) {
        $(this).addClass('jdsCoponSwitch' + (i + 1));
        $('.jdsCoponSwitch' + (i + 1)).Plugin_CoponSwitch({
          speed: root.getAttrSet($(this), 'speed', 'fast', '', true)
        }, root);
      });
    }
  }, {
    key: "tabBox",
    value: function tabBox() {
      if ($('.jdsTab').length <= 0) {
        return;
      }

      ;
      console.log('tabBox run');
      var root = this;
      $('.jdsTab').each(function (i) {
        var this_jdsTab = $(this);
        var this_sessionStorage = 'jdsTab' + i;// sessionStorage 在 IE 下看必须在服务器端看 本地看时报错的
        this_jdsTab.addClass('jdsTab' + i);
        var jdsTabMain = $(this_jdsTab).find('.jdsTabMain');
        var jdsTabNav_li = $(this_jdsTab).find('.jdsTabNav li');
        var jdsTabNavDown_li = $(this_jdsTab).find('.jdsTabNavDown li');
        var fadeSpeed = root.getAttrSet(this_jdsTab, 'fadeSpeed', 0, '', true);
        var show_eq = root.getAttrSet(this_jdsTab, 'show', 1, '', true) - 1;
        var downAnimate = root.getAttrSet(this_jdsTab, 'downAnimate', true);
        var sessionOn = root.getAttrSet(this_jdsTab, 'sessionOn', true);
        $(jdsTabNav_li).each(function (i) {
          $(this).click(function () {
            $(jdsTabNav_li).removeClass('active');
            $(jdsTabNav_li).eq(i).addClass('active');
            sessionStorage.setItem(this_sessionStorage, i);
            $(jdsTabMain).fadeOut(0);
            $(jdsTabMain).eq(i).fadeIn(fadeSpeed, function () {//
            });
            $(jdsTabNavDown_li).removeClass('active');
            $(jdsTabNavDown_li).eq(i).addClass('active');
          });
        });
        $(jdsTabNavDown_li).each(function (i) {
          $(this).click(function () {
            $(jdsTabNav_li).removeClass('active');
            $(jdsTabNav_li).eq(i).addClass('active');
            sessionStorage.setItem(this_sessionStorage, i);
            $(jdsTabMain).fadeOut(0);
            $(jdsTabMain).eq(i).fadeIn(fadeSpeed, function () {
              if (downAnimate != 'false') {
                setTimeout(function () {
                  $('html, body').not(':animated').animate({
                    scrollTop: $(this_jdsTab).offset().top
                  }, 600, 'swing');
                }, 600);
              }
            });
            $(jdsTabNavDown_li).removeClass('active');
            $(jdsTabNavDown_li).eq(i).addClass('active');
          });
        });

        if (parseInt(sessionStorage.getItem(this_sessionStorage)) + 1 && sessionOn == true) {
          $(jdsTabNav_li).eq(parseInt(sessionStorage.getItem(this_sessionStorage))).trigger('click');
        } else {
          $(jdsTabNav_li).eq(show_eq).trigger('click');
        }
      });
    }
  }, {
    key: "triggerClick",
    value: function triggerClick() {
      if ($('.jdsTriggerClick').length <= 0) {
        return;
      }

      ;
      $('.jdsTriggerClick').each(function () {
        $(this).trigger('click');
      });
    }
  }, {
    key: "swiper",
    value: function swiper() {
      var _this5 = this;

      if ($('.jdsSwiper').length <= 0) {
        return;
      }

      ;
      console.log('swiper run');
      $('<link>').attr({
        rel: 'stylesheet',
        type: 'text/css',
        href: 'https://img.travel.rakuten.co.jp/special/supersale/201706/css/swiper.min.css'
      }).appendTo('head');
      $('.jdsSwiper').Plugin_LoadJS({
        about: 'swiper.min.js',
        url: ['https://cdnjs.cloudflare.com/ajax/libs/Swiper/3.4.2/js/swiper.min.js'],
        successDo: function successDo() {
          var root = _this5;
          $('.jdsSwiper').each(function (i) {
            var mySwiper = 'mySwiper' + (i + 1);
            var mySwiperClass = 'jdsSwiper' + (i + 1);
            $(this).addClass(mySwiperClass);
            mySwiperClass = '.' + 'jdsSwiper' + (i + 1);
            var this_swiperSetup = root.getAttrSet(this, 'swiperSetup', '');
            this_swiperSetup = $.parseJSON(this_swiperSetup.replace(/'/g, '"'));
            var mySwiper = new Swiper($(mySwiperClass), this_swiperSetup);
          });
        }
      });
    }
  }, {
    key: "multiCheck",
    value: function multiCheck() {
      if ($('.jdsMultiCheck').length <= 0) {
        return;
      }

      ;
      console.log('multiCheck run');
      $('.jQ-mc').each(function () {
        var this_jQ_mc = $(this);
        var this_jQ_mc_allBtn = $(this_jQ_mc).find('.multi-check li a').not('.allBtn');
        var this_mc_act = '.multi-check li a.active';
        $(this_jQ_mc_allBtn).each(function (i) {
          $(this).click(function () {
            $(this_jQ_mc).find('.block').hide();
            $(this_jQ_mc).find('.multi-check .allBtn').removeClass('active');
            $(this).toggleClass('active');
            var this_type = $(this).attr('title');
            showNeed(this_jQ_mc);
            showAll(this_jQ_mc);
          });
        });
        $(this_jQ_mc).find('.multi-check .allBtn').click(function () {
          $(this).toggleClass('active');
          $(this_jQ_mc_allBtn).removeClass('active');
          showAll2B(this_jQ_mc);
        });

        function showAll(this_jQ_mc) {
          var activeL = $(this_jQ_mc).find(this_mc_act).length;

          if (activeL == '0') {
            $(this_jQ_mc).find('.block').show();
          }
        }

        ;

        function showAll2B(this_jQ_mc) {
          $(this_jQ_mc).find('.block').show();
        }

        ;

        function showNeed(this_jQ_mc) {
          if ($(this_jQ_mc).find(this_mc_act).length == 0) {
            $(this_jQ_mc).find('.block').show();
          } else {
            $(this_jQ_mc).find('.block').hide();
            var num = $(this_jQ_mc).find(this_mc_act).length;
            $(this_jQ_mc).find('.block').attr('class', 'block');

            var _loop = function _loop() {
              var this_id = $(this_jQ_mc).find(this_mc_act).eq(i).attr('title');
              $(this_jQ_mc).find('.block').each(function (c) {
                if ($(this).find('p.icoBtns span').hasClass(this_id)) {
                  $(this).addClass('needYou' + i);
                }

                ;
              });
            };

            for (i = 0; i < num; i++) {
              _loop();
            }

            ;
            $(this_jQ_mc).find('.block').each(function (q) {
              var this_class = $(this).attr('class');

              if ($(this).find('p.icoBtns span').length >= num) {
                //==
                var len = this_class.split('needYou').length - 1;

                if (len == num) {
                  $(this).show();
                }

                ;
              }

              ;
            });
          }

          ;
        }

        ;
      });
    }
  }, {
    key: "singleCheck",
    value: function singleCheck() {
      if ($('.jdsSingleCheck').length <= 0) {
        return;
      }

      ;
      console.log('jdsSingleCheck run');
      $('.jQ-sc').each(function () {
        var this_jQ_sc = $(this);
        var this_jQ_sc_allBtn = $(this_jQ_sc).find('.single-check li a').not('.allBtn');
        $(this_jQ_sc_allBtn).each(function (i) {
          $(this).click(function () {
            $(this_jQ_sc).find('.block').hide();
            $(this_jQ_sc).find('.single-check li a').removeClass('active');
            $(this).toggleClass('active');
            var this_type = $(this).attr('title');
            showNeed2(this_jQ_sc);
            showAll2(this_jQ_sc);
          });
        });
        $(this_jQ_sc).find('.single-check .allBtn').click(function () {
          $(this).toggleClass('active');
          $(this_jQ_sc_allBtn).removeClass('active');
          showAll22(this_jQ_sc);
        });

        function showAll2(this_jQ_sc) {
          var activeL = $(this_jQ_sc).find('.single-check li a.active').length;

          if (activeL == '0') {
            $(this_jQ_sc).find('.block').show();
          }
        }

        ;

        function showAll22(this_jQ_sc) {
          $(this_jQ_sc).find('.block').show();
        }

        ;

        function showNeed2(this_jQ_sc) {
          if ($(this_jQ_sc).find('.single-check  li a.active').length == 0) {
            $(this_jQ_sc).find('.block').show();
          } else {
            $(this_jQ_sc).find('.block').hide();
            var num = $(this_jQ_sc).find('.single-check  li a.active').length;
            $(this_jQ_sc).find('.block').attr('class', 'block');

            var _loop2 = function _loop2() {
              var this_id = $(this_jQ_sc).find('.single-check  li a.active').eq(i).attr('title');
              $(this_jQ_sc).find('.block').each(function (c) {
                if ($(this).find('p.icoBtns span').hasClass(this_id)) {
                  $(this).addClass('needYou' + i);
                }

                ;
              });
            };

            for (i = 0; i < num; i++) {
              _loop2();
            }

            ;
            $(this_jQ_sc).find('.block').each(function (q) {
              var this_class = $(this).attr('class');

              if ($(this).find('p.icoBtns span').length >= num) {
                //==
                var len = this_class.split('needYou').length - 1;

                if (len == num) {
                  $(this).show();
                }

                ;
              }

              ;
            });
          }

          ;
        }

        ;
      });
    }
  }, {
    key: "searchRight",
    value: function searchRight() {
      if ($('.jdsSearchRight').length <= 0) {
        return;
      }

      ;
      console.log('searchRight run');
      $('.jdsSearchRight').each(function (i) {
        var this_searchRight = $(this);
        $(this_searchRight).find('.thisBtn').css({
          'position': 'fixed',
          'top': '50%',
          'right': '0'
        });
        $(this_searchRight).find('.thisBox').css({
          'position': 'fixed',
          'top': '0',
          'right': '-100%',
          'width': '100%'
        });
        $(this_searchRight).find('#search-box').css({
          'margin': '0 auto'
        });
        $(this_searchRight).find('.thisBtn').click(function () {
          $(this_searchRight).find('.thisBox').animate({
            'marginRight': '100%'
          }, 'swing');
          $(this).hide();
        });
        $(this_searchRight).find('.thisClose').click(function () {
          $(this_searchRight).find('.thisBox').animate({
            'marginRight': '0%'
          }, 'swing');
          $(this_searchRight).find('.thisBtn').show();
        });
      });
    }
  }, {
    key: "searchLight",
    value: function searchLight() {
      if ($('.jdsSearchLight').length <= 0) {
        return;
      }

      ;
      console.log('searchLight run');
      $('.jdsSearchLight').each(function (i) {
        var this_searchRight = $(this);
        $(this_searchRight).find('.thisBox').css({
          'display': 'none',
          'position': 'fixed',
          'top': '0',
          'left': '0',
          'width': '100%'
        });
        $(this_searchRight).find('#search-box').css({
          'margin': '0 auto'
        });
        $(this_searchRight).find('.thisBtn').click(function () {
          $(this_searchRight).find('.thisBox').fadeIn('swing');
        });
        $(this_searchRight).find('.thisClose').click(function () {
          $(this_searchRight).find('.thisBox').fadeOut('swing');
        });
      });
    }
  }, {
    key: "searchSp",
    value: function searchSp() {
      if ($('.jdsSearchSp').length <= 0 || this.W > 720) {
        return;
      }

      ;
      console.log('searchSp run');
      var searchBox = $('#search-box');
      $('.jdsSearchSp').append(searchBox);
      $('.jdsSearch #search-box').hide();
    }
  }, {
    key: "imgOver",
    value: function imgOver() {
      if ($('img.jdsImgOver').length <= 0) {
        return;
      }

      ;
      console.log('imgOver run');
      var aPreLoad = new Array();
      var sTempSrc;
      var aImages = document.getElementsByTagName('img');

      for (var _i = 0; _i < aImages.length; _i++) {
        if (aImages[_i].className == 'jdsImgOver') {
          (function () {
            var src = aImages[_i].getAttribute('src');

            var ftype = src.substring(src.lastIndexOf('.'), src.length);
            var hsrc = src.replace(ftype, '_o' + ftype);

            aImages[_i].setAttribute('hsrc', hsrc);

            aPreLoad[_i] = new Image();
            aPreLoad[_i].src = hsrc;

            aImages[_i].onmouseover = function () {
              sTempSrc = this.getAttribute('src');
              this.setAttribute('src', this.getAttribute('hsrc'));
            };

            aImages[_i].onmouseout = function () {
              if (!sTempSrc) sTempSrc = this.getAttribute('src').replace('_o' + ftype, ftype);
              this.setAttribute('src', sTempSrc);
            };
          })();
        }

        ;
      }

      ;
    }
  }, {
    key: "megaMenu",
    value: function megaMenu() {
      var _this6 = this;

      if ($('.jdsMegaMenu.megamenu').length <= 0) {
        return;
      }

      ;
      console.log('megaMenu run');
      $('<link>').attr({
        rel: 'stylesheet',
        type: 'text/css',
        href: 'https://img.travel.rakuten.co.jp/special/xmas/2016/css/jquery.megamenu.css'
      }).appendTo('head');
      $('.jdsMegaMenu').Plugin_LoadJS({
        about: 'jquery.megamenu.js http://www.geektantra.com/2010/05/jquery-megamenu-2/',
        url: ['https://img.travel.rakuten.co.jp/special/xmas/2016/js/jquery.megamenu.js'],
        successDo: function successDo() {
          var root = _this6;
          $('.jdsMegaMenu').each(function (i) {
            $(this).addClass('jdsMegaMenu' + (i + 1)).hide();
            var this_megamenuSetup = root.getAttrSet(this, 'megamenuSetup', '');
            this_megamenuSetup = $.parseJSON(this_megamenuSetup.replace(/'/g, '"'));
            $('.jdsMegaMenu' + (i + 1)).megamenu(this_megamenuSetup);
          });
        }
      });
    }
  }, {
    key: "mapList",
    value: function mapList() {
      if ($('.jdsMapList').length <= 0) {
        return;
      }

      ;
      console.log('mapList run');
      var root = this;
      $('.jdsMapList').each(function () {
        var self = $(this);
        var this_MapListMain = self.find('.jdsMapListMain');
        var this_MapListMain_dl = this_MapListMain.find('dl');
        var this_MapListMap = self.find('.jdsMapListMap img');
        this_MapListMap.hide();
        this_MapListMap.eq(0).show();
        this_MapListMain_dl.find('dt').next().hide();
        this_MapListMain_dl.each(function (i) {
          if (root.W > 720) {
            $(this).hover(function () {
              $(this).find('dt').next().show();
              this_MapListMap.hide();
              this_MapListMap.eq(i + 1).show();
            }, function () {
              $(this).find('dt').next().hide();
            });
          } else {
            $(this).find('dt').addClass('jdsCoponSwitch');
          }

          ;
        });
      });
    }
  }, {
    key: "smartMenu",
    value: function smartMenu() {
      if ($('.jdsSmartMenu').length <= 0) {
        return;
      }

      ;
      console.log('smartMenu run');
      $('<link>').attr({
        rel: 'stylesheet',
        type: 'text/css',
        href: 'https://vadikom.github.io/smartmenus/src/css/sm-core-css.css'
      }).appendTo('head');
      $('.jdsSmartMenu').Plugin_LoadJS({
        about: 'jquery.smartmenus.js https://www.smartmenus.org/docs/',
        url: ['https://img.travel.rakuten.co.jp/special/xmas/2016/js/jquery.smartmenus.js'],
        successDo: function successDo() {
          $('.jdsSmartMenu').each(function (i) {
            $(this).addClass('jdsSmartMenu' + (i + 1));
            $('.jdsSmartMenu' + (i + 1)).smartmenus();
            $('.jdsSmartMenu' + (i + 1) + ' li a.has-submenu').each(function (i) {
              $(this).click(function () {
                $(this).next('ul').slideToggle(200).toggleClass('jb');

                if ($(this).next('ul').hasClass('jb')) {
                  $(this).find('.sub-arrow').html('-');
                } else {
                  $(this).find('.sub-arrow').html('+');
                }

                ;
                return false;
              });
            });
          });
        }
      });
    }
  }, {
    key: "animate",
    value: function animate() {
      if (!this.opt.animateOn) {
        return;
      }

      ;
      console.log('animate onload');
      $('<link>').attr({
        rel: 'stylesheet',
        type: 'text/css',
        href: 'https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.5.2/animate.min.css'
      }).appendTo('head');
      $(".animated[jdsAnimatedH]").each(function () {
        var _this = $(this);

        _this.hover(function () {
          _this.addClass(_this.attr('jdsAnimatedH'));
        }, function () {
          _this.removeClass(_this.attr('jdsAnimatedH'));
        });
      });
    }
  }, {
    key: "wow",
    value: function wow() {
      if (!this.opt.animateOn || !this.opt.wowOn) {
        return;
      }

      ;
      console.log('wow onload');
      $('body').Plugin_LoadJS({
        about: 'wow.min.js https://github.com/matthieua/WOW',
        url: ['https://img.travel.rakuten.co.jp/kaigai_package/select/pic/js/wow.min.js'],
        successDo: function successDo() {
          new WOW().init();
        }
      });
    }
  }, {
    key: "baguetteBox",
    value: function (_baguetteBox) {
      function baguetteBox() {
        return _baguetteBox.apply(this, arguments);
      }

      baguetteBox.toString = function () {
        return _baguetteBox.toString();
      };

      return baguetteBox;
    }(function () {
      if ($('.jdsBaguetteBox').length <= 0) {
        return;
      }

      ;
      console.log('baguetteBox run');
      $('<link>').attr({
        rel: 'stylesheet',
        type: 'text/css',
        href: 'https://cdnjs.cloudflare.com/ajax/libs/baguettebox.js/1.8.2/baguetteBox.min.css'
      }).appendTo('head');
      $('.jdsBaguetteBox').Plugin_LoadJS({
        about: 'baguetteBox.min.js https://github.com/feimosi/baguetteBox.js',
        url: ['https://feimosi.github.io/baguetteBox.js/js/baguetteBox.js'],
        //之前的引用版本有 error 错误
        successDo: function successDo() {
          baguetteBox.run('.jdsBaguetteBox');
        }
      });
    })
  }, {
    key: "colorBox",
    value: function colorBox() {
      var _this7 = this;

      if ($('a.jdsColorBoxImg').length <= 0 && $('a.jdsColorBoxUrl').length <= 0 && $('a.jdsColorBoxHtml').length <= 0) {
        return;
      }

      ;
      console.log('colorBox run');
      $('<link>').attr({
        rel: 'stylesheet',
        type: 'text/css',
        href: 'https://travel.rakuten.co.jp/movement/kouchi/201603/css/colorbox.css'
      }).appendTo('head');
      var jdsColorBoxImgArr = [];
      $('body').Plugin_LoadJS({
        about: 'jquery.colorbox.js http://www.jacklmoore.com/colorbox/',
        url: ['https://travel.rakuten.co.jp/movement/kouchi/201603/js/jquery.colorbox.js'],
        successDo: function successDo() {
          var root = _this7; //only one

          $('.jdsColorBoxImg:not([rel])').each(function (i) {
            $(this).addClass('jdsColorBoxImg' + (i + 1));
            $('.' + 'jdsColorBoxImg' + (i + 1)).colorbox();
          }); //group

          $('.jdsColorBoxImg[rel]').each(function (i) {
            var this_group = $(this).attr('rel');

            if ($.inArray(this_group, jdsColorBoxImgArr) == -1) {
              jdsColorBoxImgArr.push(this_group);
            }

            ;
          });

          for (var i = 0; i < jdsColorBoxImgArr.length; i++) {
            $('.' + jdsColorBoxImgArr[i]).colorbox({
              rel: jdsColorBoxImgArr[i]
            });
          }

          ; //url

          $('.jdsColorBoxUrl').each(function (i) {
            $(this).addClass('jdsColorBoxUrl' + (i + 1));
            $('.' + 'jdsColorBoxUrl' + (i + 1)).colorbox({
              iframe: true,
              width: root.getAttrSet(this, 'thisWidth', '80%'),
              height: root.getAttrSet(this, 'thisHeight', '80%')
            });
          }); //html box

          $('.jdsColorBoxHtml').each(function (i) {
            $(this).addClass('jdsColorBoxHtml' + (i + 1));
            $('.' + 'jdsColorBoxHtml' + (i + 1)).colorbox({
              inline: true,
              width: root.getAttrSet(this, 'thisWidth', '80%'),
              height: root.getAttrSet(this, 'thisHeight', '80%')
            });
          });
        }
      });
    }
  }, {
    key: "macy",
    value: function macy() {
      var _this8 = this;

      if ($('.jdsMacy').length <= 0) {
        return;
      }

      ;
      console.log('macy run');
      $('.jdsMacy').Plugin_LoadJS({
        about: 'macy.js https://macyjs.com/',
        url: ['http://macyjs.com/assets/js/macy.min.js'],
        successDo: function successDo() {
          var root = _this8;
          $('.jdsMacy').each(function (i) {
            var masonry = 'jdsMacy' + (i + 1);
            var myMacyClass = '.' + 'jdsMacy' + (i + 1);
            $(this).addClass('jdsMacy' + (i + 1));
            var masonry = new Macy({
              container: myMacyClass,
              trueOrder: false,
              waitForImages: false,
              useOwnImageLoader: false,
              debug: true,
              mobileFirst: true,
              columns: root.getAttrSet(this, 'columns', 4, '', true),
              margin: root.getAttrSet(this, 'margin', 24, '', true),
              breakAt: {
                720: root.getAttrSet(this, 'sp', 2, '', true)
              }
            });
          });
        }
      });
    }
  }, {
    key: "skrollr",
    value: function skrollr() {
      if (!this.opt.skrollrOn) {
        return;
      }

      ;
      console.log('skrollr onload');
      $('body').Plugin_LoadJS({
        about: 'skrollr.min.js https://github.com/Prinzhorn/skrollr',
        url: ['https://prinzhorn.github.io/skrollr/dist/skrollr.min.js'],
        successDo: function successDo() {//
        }
      });
    }
  }]);

  return JDS;
}(); // ==============================================================================================================================


(function ($) {
  //tile.js
  $.fn.tile = function (columns) {
    var tiles,
        max,
        c,
        h,
        last = this.length - 1,
        s;
    if (!columns) columns = this.length;
    this.each(function () {
      s = this.style;
      if (s.removeProperty) s.removeProperty('height');
      if (s.removeAttribute) s.removeAttribute('height');
    });
    return this.each(function (i) {
      c = i % columns;
      if (c == 0) tiles = [];
      tiles[c] = $(this);
      h = tiles[c].height();
      if (c == 0 || h > max) max = h;
      if (i == last || c == columns - 1) $.each(tiles, function () {
        this.height(max);
      });
    });
  };
})(jQuery); // ==============================================================================================================================


(function ($) {
  //AngaAnima
  var AngaAnima = function AngaAnima(ele, opt) {
    this.$ele = ele;
    this.defaults = {
      animaSpeed: 600,
      moreY: 0,
      moreDo: function moreDo() {}
    };
    this.options = $.extend({}, this.defaults, opt);
  };

  AngaAnima.prototype = {
    AngaAnimaMe: function AngaAnimaMe() {
      var self = this,
          angaID,
          angaGO;
      self.$ele.click(function () {
        angaID = $(this).attr('href');

        if ($(angaID).length > 0) {
          angaGO = parseInt($(angaID).offset().top); // tile.js must do it!

          $('html, body').not(':animated').animate({
            scrollTop: angaGO - self.options.moreY
          }, self.options.animaSpeed, 'swing', function () {//maybe need somting
          });

          if (angaID == "#search-box") {
            $("#searchTitle").addClass("close");
            $("#searchTitle").removeClass("open");
            $("#search-box-body").slideDown();
          }

          return false;
        }
      });
    }
  };

  $.fn.Plugin_AngaAnima = function (options) {
    var Plugin_AngaAnima_Run = new AngaAnima(this, options);
    Plugin_AngaAnima_Run.AngaAnimaMe();
  };
})(jQuery); // ==============================================================================================================================


(function ($) {
  //AngaLoad
  var AngaLoad = function AngaLoad(ele, opt) {
    this.angaGO = 0;
    this.defaults = {
      speeder: 600,
      moreY: 0
    };
    this.options = $.extend({}, this.defaults, opt);
  };

  AngaLoad.prototype = {
    angaLoadCore: function angaLoadCore() {
      var hash = location.hash;
      var self = this;

      if ($(hash).length > 0) {
        this.angaLoadCoreGo(hash);
        $('html, body').not(':animated').animate({
          scrollTop: this.angaGO - self.options.moreY
        }, this.options.speeder, 'swing');
      }
    },
    angaLoadCoreGo: function angaLoadCoreGo(hash) {
      this.angaGO = $(hash).offset().top - this.angaGO;
      return this.angaGO;
    }
  };

  $.fn.Plugin_AngaLoad = function (options) {
    var Plugin_AngaLoad_Run = new AngaLoad(this, options);
    Plugin_AngaLoad_Run.angaLoadCore();
  };
})(jQuery); // ==============================================================================================================================


(function ($) {
  //load JS file
  var LoadJS = function LoadJS(ele, opt) {
    this.ele = ele, this.defaults = {
      about: '',
      url: [],
      successDo: function successDo() {}
    }, this.options = $.extend({}, this.defaults, opt);
  };

  LoadJS.prototype = {
    LoadJSDo: function LoadJSDo() {
      var self = this;

      if ($(this.ele.selector).length && this.options.url.length) {
        for (var item in this.options.url) {
          $.getScript(this.options.url[item], function () {
            self.LoadJSDoMore();
          });
        }
      }
    },
    LoadJSDoMore: function LoadJSDoMore() {
      this.options.successDo();
    }
  };

  $.fn.Plugin_LoadJS = function (url) {
    var Plugin_LoadJDSJS_RUN = new LoadJS(this, url);
    Plugin_LoadJDSJS_RUN.LoadJSDo();
  };
})(jQuery); // ==============================================================================================================================


(function ($) {
  //ShowFix
  var ShowFix = function ShowFix(ele, opt) {
    this.$ele = ele, this.timer = null, this._rt = '.rt-header', this.defaults = {
      fixY: 'body',
      showSpeed: 300,
      showOnly: false,
      moreDO: function moreDO() {}
    }, this.options = $.extend({}, this.defaults, opt);
  };

  ShowFix.prototype = {
    scrollMe: function scrollMe(ojb) {
      if ($(this.options.fixY).length > 0) {
        // 对象位置每次滚动都会实时获取，不会存在onload问题
        this._fixY = $(this.options.fixY).offset().top;

        if ($(document).scrollTop() > this._fixY) {
          this.$ele.addClass('active');

          if ($(this.$ele).is(':hidden')) {
            this.$ele.fadeIn(this.options.showSpeed);
          } else {
            this.$ele.fadeIn(0);
          }
        } else {
          this.$ele.removeClass('active');

          if (!$(this.$ele).is(':hidden')) {
            this.$ele.fadeOut(this.options.showSpeed);
          } else {
            this.$ele.fadeOut(0);
          }
        }

        ;
      } else {
        throw new Error('jdsShowFix.fixY - 参数错误');
      }

      ;

      if ($(this.options.showOnly).length > 0) {
        // 对象位置每次滚动都会实时获取，不会存在onload问题
        if ($(document).scrollTop() + $(window).height() > $(this.options.showOnly).offset().top + $(this.options.showOnly).height()) {
          this.$ele.addClass('active2');
          this.$ele.css({
            'position': 'absolute'
          });
        } else {
          this.$ele.removeClass('active2');
          this.$ele.css({
            'position': 'fixed'
          });
        }
      }

      ;
    },
    windowScroll: function windowScroll() {
      this.$ele.hide();
      var self = this;
      self.scrollMe(this.$ele);
      var windowsW = $(window).width(); // 默认就先实行一次

      self.scrollMe(self.$ele);
      $(window).scroll(function () {
        self.scrollMe(self.$ele);
      });
    }
  };

  $.fn.Plugin_ShowFix = function (options) {
    var Plugin_ShowFix_Run = new ShowFix(this, options);
    Plugin_ShowFix_Run.windowScroll();
    return this;
  };
})(jQuery); // ==============================================================================================================================


(function ($) {
  //AlwaysFix
  var AlwaysFix = function AlwaysFix(ele, opt) {
    this.$ele = ele, this._rt = '.rt-header', this.timer = null, this.defaults = {
      moreY: 0
    }, this.options = $.extend({}, this.defaults, opt);
  };

  AlwaysFix.prototype = {
    scrollMe: function scrollMe() {
      this._ele = $(this.$ele).offset().top;
      this._defTtop = $(this.$ele).css('top');
      var self = this;
      self.scrollBase();
      $(window).scroll(function () {
        if (self.timer) {
          clearTimeout(self.timer);
        }

        ;
        self.timer = setTimeout(function () {
          self.scrollBase();
        }, 0);
      });
    },
    scrollBase: function scrollBase() {
      var self = this;

      if ($(document).scrollTop() > self._ele - self.options.moreY) {
        self.$ele.addClass('active').css({
          'position': 'fixed',
          'top': self.options.moreY
        });
      } else {
        // 对象位置每次滚动都会实时获取，不会存在onload问题
        this._ele = $(this.$ele).offset().top;
        self.$ele.removeClass('active').css({
          'position': '',
          'top': self._defTtop
        });
      }
    }
  };

  $.fn.Plugin_AlwaysFix = function (options) {
    var Plugin_AlwaysFix_Run = new AlwaysFix(this, options);
    Plugin_AlwaysFix_Run.scrollMe();
  };
})(jQuery); // ==============================================================================================================================


(function ($) {
  //CoponSwitch
  var CoponSwitch = function CoponSwitch(ele, opt, root) {
    this.$ele = ele, this.defaults = {
      speed: 'fast'
    }, this.options = $.extend({}, this.defaults, opt), this.root = root;
  };

  CoponSwitch.prototype = {
    coponSwitchCore: function coponSwitchCore() {
      var self = this;
      $(this.$ele).each(function (i) {
        var speed = self.options.speed;

        if ($(this).attr('class').indexOf('active-submenu') < 0) {
          $(this).next().hide();
        }

        ;
        $(this).click(function () {
          if ($(this).next().is(':hidden')) {
            $(this).addClass('active-submenu');
            $(this).next().slideDown(speed, function () {//
            });
          } else {
            $(this).removeClass('active-submenu');
            $(this).next().slideUp(speed, function () {//
            });
          }
        });
      });
    }
  };

  $.fn.Plugin_CoponSwitch = function (options, root) {
    var Plugin_CoponSwitch_Run = new CoponSwitch(this, options, root);
    Plugin_CoponSwitch_Run.coponSwitchCore();
  };
})(jQuery); // ==============================================================================================================================